/*
 * This file is part of Ember.
 *
 * Ember is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Ember is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Ember.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright (C) Grant Tyra 2010
 * granttyra@gmail.com
*/

#ifndef EMBER_LIST_H
#define EMBER_LIST_H

#include "ember_config.h"

typedef struct EmberListNode_s {
	struct EmberListNode_s *next;
	void *data;
} EmberListNode;

typedef struct EmberList_s {
	EmberListNode *root;
	int size;
} EmberList;

EMBER_EXPORT EmberList *EmberListCreate(void);
EMBER_EXPORT void EmberListDestroy(EmberList*);

EMBER_EXPORT int EmberListAdd(EmberList*, void*);
EMBER_EXPORT int EmberListSet(EmberList*, int, void*);
EMBER_EXPORT int EmberListRemove(EmberList*, int);
EMBER_EXPORT int EmberListFind(EmberList*, void*);
EMBER_EXPORT void *EmberListGet(EmberList*, int);

#endif
